<extend name="category/index" />
<block name="main1">
	<script src="__PUBLIC__/jquery-1.8.3.min.js"></script>
	
</block>
<block name="main">
	 <div class="container" style="margin-top:50px">
	 <center>
	 	<div class="col-md-8">
	 		<div class="col-md-5 pull-right">
	 				 	<form action="<{:U('ForgetPassword/securityPass')}>" id="form3" method="post">
	 					<h3>手机号:</h3>
	 					<input type="text" class="phone1 form-control">
	 					<p id="haha"></p>
	 					</form>
	 					<br><br>
	 					<button class="btn btn-primary" id="anniu">下一步</button>
	 			</div>
	 		</div>
	 		 	
	 	
	 </center>
	 	
	 </div>
	
		<!-- <input type="submit" value="下一步"  id="anniu"> -->
		<a href=""></a>
	<script>
		$(function(){
			$('#anniu').click(function(){
				var phone = $('.phone1').val();
				// console.log(phone);
				if(phone == '') {
					// alert('手机号码不能为空');
					$('#haha').css('color','red').html('手机号码不能为空');
					return false;
				}
				$.ajax({
					type:'post',
					url:"<{:U('ForgetPassword/doajax')}>",
					data:{'phone':phone},
					success:function(data) {
						// console.log(data);
						if(data) {
							 $('#form3').submit();
						} else {
							// alert('手机号不存在');
							$('#haha').css('color','red').html('手机号码不存在');

						}
					},
					dataType:'json',
				})

			})
		})
	</script>
</block>

